<template>
    <div class="goods-detial">
        <div class="goods-detial-content">
            <detialitem  v-for="item in detiallist" :key="item.id" :itemdata="item" />
        </div>
    </div>
</template>

<script setup lang="ts">
import detialitem from './detialitem.vue'
import {ref} from 'vue'
import {getdetialDataApi} from '@/api/detail'
import { onMounted } from 'vue';
import { computed } from 'vue';
const props=defineProps<{
    data:string
    order?:string
}>()
const detiallist = ref<detialNs.IdetialgoodsList[]>([])

const ishot =  props.data == '1' ? '1' :''
const isNew = props.data == '2' ? '1' : ''

const getDetilHandler = async () =>{
    let res = await getdetialDataApi((ishot as unknown as  string),(isNew as unknown as  string),'')
    detiallist.value =res.data
    
}
onMounted(() =>{{
    getDetilHandler()
}})
</script>

<style scoped lang="scss">
.goods-detial {
    width: 100%;
    overflow: hidden;
    margin-top: 6px;
    box-sizing: border-box;
    .goods-detial-content {
        margin: 0 auto;
        width: 3.56rem;
        // height: 1000px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;

    } 
}</style>